a=list()
a=[7,1,2,3,8,4,5,6]
index=2
q=7
f=0
for i in range(1,len(a)):
    # print(a[i])
    temp = q
    q = a[i] + f
    f = max(temp, f)
    print(q)



print(max(q,f))